home *** CD-ROM | disk | FTP | other *** search
- Path: stc06.ctd.ornl.gov!mbk
- From: mbk@jt3ws1.etd.ornl.gov (Kennel)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Date: 4 Jan 1996 20:58:36 GMT
- Organization: Oak Ridge National Lab, Oak Ridge, TN
- Message-ID: <4chf1s$rg7@stc06.ctd.ornl.gov>
- References: <cmanDK7x13.5KM@netcom.com> <verec-2712952049000001@ppp30.micronet.fr> <30E39BC0.3BAE@zeta.org.au>
- Reply-To: kennel@msr.epm.ornl.gov
- NNTP-Posting-Host: jt3ws1.etd.ornl.gov
- X-Newsreader: TIN [version 1.2 PL2]
-
- > Jean-Francois Brouillet wrote:
- > > Completely agree that scope is much more important than type encoding.
- > > An additional convention, borrowed from PowerPlant is:
- > > > > void
- > > myFunc(
- > > UInt32 inLongArgument,
- > > UInt16 & outShortArgument,
- > > char * ioCommandOnInputResultOnOutput);
- > > [snip]
-
- > Jean-Francois, I quite like this... reminds me of Pascal, but it adds value
- > to the variable name.
-
- > I only got one bite with the following, last time I posted it here...
- > What about using things built into the language to tell the reader what
- > things are used for ? Not only can the resultant code be read easily by
- > anyone who has a good working knowledge of the language, but it can help
- > enforce such things as input-only, etc.
-
- > For function parameters which are input only, pass by value or by const
- > reference. Pass by const pointer in the case of an array (passing by
- > reference implies singular, by pointer implies multiple).
-
- Or, of course, one could do the obvious thing and decorate arguments with
- that simply awful convention of "in" "out" and "inout" keywords like
- Ada and Sather.
-
- > Parameters used to return values can be specified as non-const reference
- > or pointer - again, reference implies singular, pointer implies multiple
- > (i.e. an array).
-
- Now look carefully at this C/C++ induced confusion of "intent of parameters"
- "constancy" "pointer vs reference semantics" "pointers vs arrays".
-
- mbk
-